Method and system for handling text that includes paragraph delimiters of differing formats

ABSTRACT

A method and word processing system for handling text pasted into a document that uses a paragraph delimiter different than that employed by the word processing system. A computer system (10) that is generally conventional in design executes a word processing program that efficiently handles text pasted into a word processing document, even though that text uses a paragraph delimiter different than the native paragraph delimiter of the word processing system. The document opened by the word processing system has a corresponding piece table that includes an array of character positions and an array of data records. Each piece of the piece table represents adjacent characters that stored together in a file, and each record or PCD in the array of data records corresponds to a different piece in the piece table. When a file is opened to select text that will be pasted into the word processing document, a corresponding entry is made in the piece table that includes pointers to a file control block (FCB) for the opened file. The FCB indicates the type of paragraph delimiter used for that text. Thus, the word processing system tracks the appropriate paragraph delimiter used and translates any foreign paragraph delimiter to the native delimiter when displaying the text for editing. When the document is saved to a file, the paragraph delimiter associated with the text is translated to the native paragraph delimiter used by the word processing system.

FIELD OF THE INVENTION

The present invention generally pertains to a method and a system forword processing text prepared under different processing or operatingsystems, and more specifically, to a method and a word processing systemfor handling text that includes paragraph delimiters of differingformats.

BACKGROUND OF THE INVENTION

It has become relatively commonplace to exchange documents created ondifferent computer systems and to paste text from such documents into anew word processing document that is being created. In this discussion,the term "imported" is used in connection with a document or filecreated on a word processing system or operating system that isdifferent than a "native" operating system or word processing system.The conventional approach for importing text produced on a differentcomputer system or by a different word processing program is to firsttranslate the entire text file into the native word processing systemformat and then to store the converted text in another file. After thetranslation and conversion operation is completed, the newly createdfile is opened so that the text can be displayed for review and editingby the user and for pasting into another document. However, if the sizeof the text being translated into the native format is relatively large,e.g., greater than 100 Kbytes, several minutes may be required tocomplete the translation process. During the time that the translationprocess and storage of the translated text occurs, the user is forced toidly wait, since the word processing system is unable to handle anyother task.

One type of translation that is often required when text is pasted intoa document from another system is the translation between paragraphdelimiters. Three types of paragraph delimiters are commonly used oncomputers. One of the more common paragraph delimiters is used in MS-DOSand in MICROSOFT™ Word for Windows prior to Version 6; it is a two-bytesequence of characters, in which the first byte corresponds to acarriage return (CR) and the second byte to a line feed (LF), i.e., thetwo-byte sequence "13 10." Word processing systems running under variousversions of the UNIX™ operating system use a single byte "10" as aparagraph delimiter, while the APPLE™ operating system and MICROSOFT™Word for Windows Version 6 use a single byte "13" for this purpose. Thedelay that is typically incurred in translating paragraph delimiters ofdocuments imported from a foreign word processing system into a nativeparagraph delimiter format arises because every character of theimported text must be scanned in sequence into memory. Any foreignformat paragraph delimiters encountered are converted into the nativeparagraph delimiter before the text is written into another file.

If foreign paragraph delimiters are not converted before the text isdisplayed to the user, unexpected results can occur. For example, if anMS-DOS or WINDOWS™ computer reads and displays a text file created usingthe paragraph delimiter without translating the paragraph delimiters,the imported text file will appear as one long paragraph, even though itmay have originally included many paragraphs. If a MACINTOSH™ computerprogram read and displays a text file created using the paragraphdelimiter employed by MS-DOS or WINDOWS, without translating theparagraph delimiters, the screen will display an unrecognizablecharacter for each of the LF characters of the two-byte sequence used asa delimiter. Similarly, a UNIX™ word processing program importing thesame text will display an unrecognizable character for each of the CRcharacters of the two-byte sequence used as a delimiter.

Properly identifying the end of each paragraph is important in most wordprocessing systems because much of the formatting is related to textgrouped by paragraphs. The default font for characters of text, themargins applied to the text, and the type of justification (right, left,or centered) are dependent upon accurately denoting the end of paragraphfor each block of text in a document. In connection with thisrequirement, any word processing program that uses (or translates) thetwo-byte sequence CRLF must avoid splitting the sequence by putting aninsertion point for text between the CR and the LF bytes of theparagraph delimiter sequence. Once the two-byte sequence is broken byinsertion of even a single character of text, the paragraph end denotedby the sequence can no longer be recognized.

Preferably, a word processing program should be able to handle foreignparagraph delimiters without first requiring that the imported text inwhich such delimiters are used first be translated and stored as aconverted file. To avoid inserting text into the two-byte sequence CRLF,the word processor should be able to keep track of the length of thedelimiter and insure that the insertion point is always on one side orthe other of the delimiter sequence. Further, if the user only wants toview a document or to edit it without saving the text, the wordprocessing system should not need to translate the foreign delimiters tothe native delimiter format. Only when a document that includes textusing the foreign paragraph delimiters is saved to a file should it benecessary to translate between paragraph delimiter types. None of theprior art word processing systems have these capabilities or operate inthis manner. By making these features available on a word processingsystem, it should be possible for users who frequently import textprepared on foreign word processing systems to save considerable time.

SUMMARY OF THE INVENTION

In accordance with the present invention, a method is defined forproperly displaying text that uses a foreign paragraph delimiter, theforeign paragraph delimiter being different than a native paragraphdelimiter used for text in documents created on a word processingsystem. This method includes the step of producing a character positionarray in which each character of a document that is open on the wordprocessing system is assigned a coordinate position. The characterposition array is divided into a plurality of pieces. Each piececomprises a string of characters that are stored adjacent to one anotherin a file. In addition, an array of data records is produced thatincludes entries corresponding to each piece of the character positionarray. Each entry includes a file number and a file position within afile at which the string of characters comprising the piece are stored.A file control block (FCB) for each file storing the text used in thedocument is produced when the file is initially opened by the wordprocessing system. Delimiter identification data are recorded in the FCBof each file. The delimiter identification data indicate a type ofparagraph delimiter used by the text stored in the file. Each time thata character of the document that was read from a file is displayed, theword processing system refers to the character position array and to thearray of data records to determine a specific file in which thecharacter is stored. The delimiter identification data in the FCB forthe specific file indicate the type of paragraph delimiter that is usedfor a paragraph containing the character. If the paragraph containingthe character uses a foreign paragraph delimiter, the foreign paragraphdelimiter is translated to the native paragraph delimiter in a displaybuffer, so that the paragraph containing the character is properlydisplayed to the user. All foreign paragraph delimiters used for text inthe document are translated to the native paragraph delimiters when thedocument is saved to a file.

The method also comprises the step of checking for a header or a trailerto the text in a file opened by the word processing system. The headeror trailer at times indicates the type of paragraph delimiter used bythe text so that corresponding delimiter identification data areprovided in the FCB for that file. For a text file that does not includea header or trailer that indicates the type of paragraph delimiter used,at least a portion of the text in the text file is scanned when the textfile is opened by the word processing system, to identify a specifictype of paragraph delimiter that is used. The delimiter identificationdata corresponding to the specific type of paragraph delimiter are thenspecified in the FCB for the text file. To determine the type ofparagraph delimiter used in the text file, any occurrences of each typeof the paragraph delimiters are counted to identify the type ofparagraph delimiter that occurs most often. The type of paragraphdelimiter that occurs most often thus determines the delimiteridentification data specified for the FCB of the text file.

For another type of file, the method includes the step of maintaining atable of limit file positions within each file. The limit file positionreports a position within the file for each paragraph delimiter usedwithin the text so that the paragraph delimiter used at that positioncan be identified.

The method further comprises the steps of determining a beginningparagraph file position for a paragraph in which a specific character oftext is found, determining a limit character position of the paragraph,and reporting the size and type of the paragraph delimiter found at theend of the paragraph. In this way, the delimiter identification datathat are inserted into the FCB for the file are determined.

Another step of the method is using the delimiter identification data toidentify any two-byte paragraph delimiter sequence that is used in thetext. When editing the document, the word processing system precludes aninsertion point from being selected between the two-bytes comprising thetwo-byte paragraph delimiter sequence.

Preferably, the method includes the step of displaying a specialcharacter that indicates an end of the paragraph for any of theplurality of different types of paragraph delimiters used for the textbeing displayed; foreign paragraph delimiter characters are notdisplayed.

Still further steps of the method include translating any foreignparagraph delimiters to the native paragraph delimiter in the documentwhen the document is saved, and producing a new character position arraythat includes pieces that do not use any foreign paragraph delimiters. Anew array of data records including entries that correspond to eachpiece of the new character position array is then produced. Each entryhas a file number for the file in which the document is saved and a fileposition within that file. After the document is saved, any calls by theword processing system to retrieve text for display and editing aredirected to the file in which the document was saved instead of to thefiles in which the pasted text was originally stored. If the step ofsaving the document is interrupted before it completes, the characterposition array and the array of data records originally produced areagain referenced to ensure that all of the character positions in thedocument are restored to their original values, including any referencesto the foreign paragraph delimiters used for the text.

An additional aspect of the present invention is a word processingsystem in which paragraphs of text that use a foreign paragraphdelimiter are properly displayed, the foreign paragraph delimiter beingdifferent than a native paragraph delimiter of documents created on theword processing system. The elements of the word processing system carryout functions that are generally consistent with the steps of the methoddiscussed above.

BRIEF DESCRIPTION OF THE DRAWING FIGURES

The foregoing aspects and many of the attendant advantages of thisinvention will become more readily appreciated as the same becomesbetter understood by reference to the following detailed description,when taken in conjunction with the accompanying drawings, wherein:

FIG. 1 is a schematic block diagram of a conventional personal computersuitable for implementing software instructions to carry out the presentinvention, as indicated by the imported text file stored on a floppydisc for pasting into a document;

FIG. 2 is a block diagram that shows the pasting of a foreign wordprocessor document (that uses a foreign paragraph delimiter) into anative word processing document;

FIG. 3 is a flow chart illustrating the logical steps implemented incarrying out the present invention;

FIG. 4 is a flow chart that shows in greater detail the steps involvedin producing a piece table;

FIG. 5 is a flow chart illustrating the details implemented in pastingtext into a document;

FIG. 6 is a flow chart showing the steps required for scanning pastedtext that does not include a header or trailer indicating the type ofparagraph delimiter used in the text;

FIG. 7 is a flow chart illustrating the logical steps for determiningthe paragraph delimiter used in text that is pasted into a document, byreference to the piece table and FCB for that text; and

FIG. 8 is a flow chart illustrating the logical steps employed in savinga document that includes pasted text, which uses foreign paragraphdelimiters.

DESCRIPTION OF THE PREFERRED EMBODIMENT Overview of Invention

With reference to FIG. 1, a personal computer system of a type suitableforimplementing the present invention as a work processing system isgenerallyillustrated at a reference number 10 in FIG. 1. Personalcomputer system 10includes a conventional desktop console 12 in which isdisposed a central processing unit (CPU), random access memory (RAM),read only memory (ROM),and other supporting circuitry and integratedcircuits, none of which is shown separately, because they are well knownto those of ordinary skill in the art. In addition, console 12 includesa floppy disk drive 14 and a hard drive 16. A display screen 18 iscoupled to console 12, as is a keyboard 20 (and any other user interfacedevice, such as a mouse--which is not shown). The CPU within console 12is preferably an INTEL™ type 80386, 80486, or PENTIUM™ processor, or anyequivalent or alternative CPU that is suitable for running a graphicsuser interface, such as WINDOWS™ 3.1, which is produced by the assigneeof the present invention. It is also contemplated that the presentinvention embodied in word processing software can be executed on aportable (or laptop) computer or on a workstation that is coupled to anetwork (neither shown),and that it can be implemented on other types ofcomputers and CPUs, such as those marketed by APPLE™.

The present invention is embodied within word processing software, thepreferred embodiment comprising the program MICROSOFT™ Word for Windows,Version 6, which is written to run under the WINDOWS™ operating systemand under other operating systems designed to run WINDOWS™ software.However, the present invention can also run in otherword processingsystems, and under different operating systems, such as theAPPLE™MACINTOSH™ System 7. It can also be embodied in word processing systemsoperating in non-graphic user interface environments, such as underMS-DOS or UNIX™.

As illustrated in FIG. 1, a text file stored on a floppy disk 22 or onharddrive 16 is provided as a source of text that will be inserted intoa native word processing document 24, which is produced by the wordprocessing system being executed on personal computer system 10. Thetext file may be ASCII, i.e., without any headers or footers of the typecommonly used in connection with word processing documents.Alternatively,as indicated in FIG. 2, a foreign word processor document26 may serve as the source of the text to be pasted into native wordprocessing document 24. The text that is pasted into the native wordprocessing document may use the same type of paragraph delimiter as thenative word processing document or a different type of paragraphdelimiter. In Word for Windows Version 6 (hereinafter referred to simplyas "WinWord 6"), a paragraph delimiter 13 is used, which is identical tothe paragraph delimiter used in the APPLE™ operating system. However,other word processing programs, MICROSOFT™ Word for MS-DOS and earlierversions of Word For Windows, text files created under MS-DOS, and otherword processing systems running under the various forms of the UNIX™operating system typically use one of the other two types of paragraphdelimiters, i.e., the two-byte delimiter 13 10 or the single byteparagraph delimiter 10.

When foreign text, i.e., text created by a different word processingprogram or under an operating system, is pasted into native wordprocessing document 24 open on WinWord 6, the foreign document can beopened immediately without the need for scanning all of the text in thedocument to translate any foreign paragraph delimiter that is used intothe native paragraph delimiter. Further, text using a foreign paragraphdelimiter can be immediately displayed on display screen 18 and editedwithout the need to translate the entire file from which the text isdrawn. Only when native word processing document 24 is saved to a filewill all foreign paragraph delimiters of any pasted text be translatedinto the native paragraph delimiters in the file.

Using the method of the present invention, text drawn from filesemploying entirely different paragraph delimiters can thus be insertedinto native word processing document 24 in a manner that issubstantially transparent to the user. In addition, the presentinvention handles two-byte paragraphdelimiters so as to ensure that textis not inserted between the two bytes comprising the paragraph delimitersequence; this error is sometimes encountered in word processing systemsin which the two-byte paragraph delimiter sequence is used as the nativeparagraph delimiter.

Description of Piece Table Data Structure

One of the key aspects of the present method is its use of a datastructurethat allows the word processing system to recognize the type ofparagraph delimiter that is used in a file in which text pasted into adocument was originally stored. The data structure that enables thisfunction is referred to as a "piece table." In the piece table, eachcharacter in a document is assigned a numerical coordinate, ranging fromthe first character at coordinate zero to the n_(th) or last character,which is assigned coordinate n-1. Thus, a piece table includes amonotonically increasing sequence of character position coordinates,with duplicates notallowed, which are stored in a variable length array.The first entry in the character position array is 0, the coordinate ofthe first character of the text that appears at the beginning of adocument, and the last coordinate position in the character positionarray contains the coordinate n for the limit character of a documentthat contains n characters. The character position array partitions thedocument into a sequence of pieces. Each piece represents a string ofcharacters that are adjacent to each other and have common formattingcharacteristics.

Although it would be hard to conceive of such a document, in the worstpossible scenario, each character in a document could have been pastedinto the document so that no adjacent characters in the document arelocated at adjacent file locations in the files that have been opened bythe word processing system. In this case, n+1 entries describing npieces would be required in the piece table for the document. Thiscondition could occur if the user inserted a new character between eachcharacter that was originally recorded in a newly opened word processingdocument. It should be apparent that most documents require far fewerpieces than this extreme case, since typically, users do not insert newcharacters at every available position within a document.

The piece table also includes an array of data records, which are keptin one-to-one correspondence with the entries recorded in the array ofdocument character positions. Each of these entries is referred to as apiece descriptor (PCD). Each record or entry comprising a PCD in thearrayof data records includes a file number identifying a particularfile and a file position within that file where the characters in thecorresponding piece can be found. Thus, if any word processing documentthat is stored in a file on hard drive 16 is opened by the wordprocessing system, the corresponding PCDs for the pieces in the array ofcharacter positions record the file number for that file and a fileposition within the file where the text referenced by the pieces can befound. Similarly, a file that is opened to enable text to be pasted intothe native word processingdocument introduces a second file identifierwithin the PCDs of the array of data records that identifies the filewhere each piece of text pasted into native word processing document 24is stored. Each such reference also indicates the file position withinthe open file at which the piece of text can be found. For example, iftwo adjacent characters in the document are at coordinate positions 100and 103 in the array of characterpositions, and the corresponding PCDfor the character at coordinate 100 points to file 2, location 1010, thecharacter in the document at coordinate 100 can be found at location1010 in file 2, and the character at coordinate 101 in the array ofcharacter positions can be found at location 1011 in file 2. Similarly,any character position coordinate in the piece table can be found byreferencing the corresponding PCD for the piece in which the characteris disposed to determine the file number and file coordinate. Furtherdetails of this process are discussed below.

It is important to distinguish between "document" and "file" in thisdiscussion. For purposes of this disclosure and the claims that follow,a document is simply a sequence of characters that is being created oredited using the word processing system and may include text pasted fromone or more files. The piece table enables the word processing system tokeep track of both the file(s) from which each character of text in thedocument open on the word processing system is pasted and the fileposition within each such file. With this information, the paragraphdelimiters that are used by text pasted into the document are readilydetermined.

Each time that a file is opened by the word processing system forpasting text into a document, information concerning the file is storedin a record referred to as an FCB. Although much other data are storedin the FCB, for purposes of the present invention, it is important tonote that WinWord 6 stores two single bit fields in the FCB thatidentify the type of paragraph delimiter used by the text stored withinthe file referenced by the FCB. The first bit field is called the "f13Term." This term is setto a binary 1 or true when the paragraphdelimiter used by text stored in the file ends in 13. Thus, this bit isset to true when the file was created on a MACINTOSH™ computer or underWinWord 6. The bit field is set to zero or false when the file to whichit relates was created under the UNIX™ operating system or by MS-DOS,since the single byte 10 and the two-byte sequence 13 10, which arerespectively used as paragraph delimiters in those instances, do not endwith the character 13. Similarly, the second bit field, which isentitled fCrLf, is set to a binary 1 or true whenever the paragraphdelimiter sequence 10 13 is used for the text in a file.

The following Table 1 shows how these two bit field terms are able touniquely identify the three paragraph delimiters.

                  TABLE 1                                                         ______________________________________                                        System (Para Delimiter)                                                                      f13Term Bit Field                                                                           fcrLf Bit Field                                  ______________________________________                                        MS-DOS/Pre-WinWord 6                                                                         False         True                                             (13 10)                                                                       MACINTOSH ™/                                                                              True          False                                            WinWord 6 (13)                                                                UNIX ™ (10) False         False                                            ______________________________________                                    

To enable identification of the appropriate FCB that should be checkedby the word processing system in order to determine the paragraphdelimiter that is used with a specific piece of text, each PCD in thearray of data records includes a small integer that is an index into anarray of pointers associated with the FCBs. The index for the FCBsstored in PCDs thus links each PCD to the relevant FCB for the file inwhich a piece of the document was originally stored. This link to theFCB provides the information for the word processing system needed toidentify the particular paragraph delimiter that is used for specifictext.

Steps of the Method for Handling Paragraph Delimiters

The logical steps involved in handling text pasted into a document inaccordance with the present invention are illustrated in a flow chart inFIG. 3. The method begins at a start block 30 and proceeds to a block 32in which the word processing software defines a piece table for nativeword processing document 24 when a document is opened by the wordprocessing system. It should be recognized that there are four possiblestates for a piece table when a document is opened. In the first case,forany document that was previously fast saved to a file, a piece tablewill exist in that file. The piece table is needed in this case becausethe text comprising the document was likely not stored in a contiguoussequence in the file. By reference to the piece table, the wordprocessingsystem will know how the pieces of text in the file knittogether to form acoherent document. The second case applies to a fullsaved word processing document. For a document that was previously fullsaved, no piece table need be stored in the document file because theheader information of the file is sufficient to describe the document,and all of the text in the document is in a natural contiguous order.The word processing system willcreate a one entry piece tableencompassing all text stored in the file when the file is first opened.The third case applies to a document that is a text file and not in thenative format of the word processing system.In this case, a piece tableis created when the file is opened that points to the first character ofthe file and ends at the last character. The fourth case applies when anew document is initially created. At that time, the word processingsystem produces an "empty" piece table consisting of a single piece.

With reference to FIG. 4, further details are shown relating to the useof the piece table for tracking editing changes/additions to thedocument. Ina block 62, the logic ensures that for each change to thedocument, whetherrelating to a modification of existing text or additionof new text, a corresponding new piece is added to the piece table forthe document. For example, if the user inserts a word in the document, acorresponding pieceindicating the character position of the new word isadded to the piece table. A block 64 indicates further detailsconcerning the addition of a piece to the piece table. According to thisstep, an entry for each new piece is made to the array of characterpositions to provide a reference to the character position of theediting change within the document. Further, a piece descriptor (PCD)recording a file number identifying a particular file and a fileposition within that file at which the characters comprising the textfor the new piece is determined, and in a block 66, is added as acorresponding entry in the array of data records. (Although the stepsdiscussed up to this point have not provided for pasting text, it shouldbe noted that if the edit to the document is pasting text from anotherfile, the PCD will point to the file number for that file from which thetext was pasted and to a file position within that file. The nextparagraph discusses this aspect of invention in greater detail.) Asindicated by a block 68, the process continues--at least until nofurther editing of the document is desired.

At a block 34 in FIG. 3, based upon a request by the user, the wordprocessing system opens the file containing the text to be pasted intonative document 24. This file may be stored on hard drive 16 or may bestored on floppy disk 22. Once the imported text file is opened, theuser is given the opportunity to select the text from the file that isto be pasted into the document. In a graphic user environment, thisselection can be accomplished using a pointing device, such as a mouse(not shown) or by using keys on keyboard 20 to select all or portions ofthe text stored in the file for pasting into the document. Next, adecision block 38 determines if the imported text includes data thatspecifically identify the type of paragraph delimiter used within thefile from which the text is drawn. Details of block 36 and of decisionblock 38 are illustrated in FIG. 5. Referring to FIG. 5, a decisionblock 70 determinesif the imported text has been drawn from a MICROSOFT™word processing system binary file. This determination is particularlyrelevant because any of the MICROSOFT™ word processing programs thathave been marketedproduce binary files when they save a document. Theseword processing binary files include headers that identify the type ofparagraph delimiterused for text stored in the file. Other wordprocessing programs from othersoftware companies also store a header ortrailer record at the beginning or end of a document file that include afield identifying the kind of paragraph delimiter used in the file forthe document.

In binary files produced by MICROSOFT™ word processing programs, theheader that is provided is referred to as a file information block(FIB). In the FIB is stored an identifier field entitled "wIdent"(fib.wIdent) that identifies the type of paragraph delimiter used. Bychecking the fib.wIdent field, the word processing system can readilydetermine the correct settings for the f13Term and fCrLf file bits thatshould be storedin the FCB for the binary file that is being opened.

If the pasted text is not from a Word binary file, the logic proceeds toa decision block 72, which determines if the text is pasted from a fileproduced by a different word processing system or other source that alsouses a trailer or header in which the type of paragraph delimiter usedin the file is identified. Assuming that the imported text file meetsthis criterion, a block 74 checks the trailer (or header) to determinethe paragraph delimiter that is used in the file.

Word processing programs also can paste text from a file that has notrailer or header, such as a plain ASCII text file like that producedusing either MS-DOS or a line editor program. In this case, a differenttechnique must be used to determine the paragraph delimiter that is usedwith the text contained within the file. As indicated in a block 76, theword processing system scans the text in the imported text file lookingfor one of the three types of paragraph delimiters, i.e., a 13, a 10, orthe two-byte sequence 13 10. This scanning operation heuristicallydetermines the appropriate paragraph delimiter that should be used forthetext pasted from the text file.

Details of the scanning operation are shown in FIG. 6. Referring to FIG.6,a block 90 indicates that the word processing system scans the first10,000bytes of text (or less if the file contains fewer characters).During this scan, it counts each occurrence of the different types ofparagraph delimiters found. In many instances, only a single type ofparagraph delimiter will be found in the text being pasted. However, itis possible that the pasted text may include multiple instances of thedifferent characters used for the different types of paragraphdelimiters, some of which will not be used as a paragraph delimiter. Bycounting the instancesof each type of paragraph delimiter found, theword processing system determines the paragraph delimiter having thehighest frequency of occurrences, and as indicated in a block 92,assigns the paragraph delimiter with the highest frequency count to alltext within the file that is being pasted into the native wordprocessing document. The type ofparagraph delimiter that occurs mostoften in the text has the highest probability of being the one that isused in the file. The process continues as indicated in a block 94,leading the logic to return to FIG. 5.

As shown in FIG. 5, after the scanning operation is completed, the logiccontinues at a block 78, transferring back to the steps of the flowchart in FIG. 3. However, before returning to FIG. 3, further steps inFIG. 5 should be considered. Specifically, if the response to decisionblock 70 indicates that the pasted text was saved in a Word binary file,the FIB for that file indicates the appropriate paragraph delimiter thatshould beused.

As already noted, text pasted into a word processing document may havebeenstored in a file that does not identify the type of paragraphdelimiter used. Accordingly, decision block 38 determines if the pastedtext identifies the paragraph delimiter that is in use by the textpasted into the document. If not, the word processing system cannot relyupon a paragraph file position table to locate paragraph delimiters inthe piece,but instead, must rely upon the heuristic scanning methoddiscussed above. After identifying the paragraph delimiter used by thepasted text, the word processing system proceeds to a block 42 in whichit creates an FCB for the imported text file in which the paragraphdelimiter used by the file is indicated by the two bit fields. In thismanner, for each piece ofinserted text that is referenced by a separatepiece within the piece table, the word processing system stores datathat include a pointer to the FCB for the file in which the text of thepiece is originally stored. The two single bit fields within the FCB canthereafter be used to determine the appropriate paragraph delimiter thatis used for text referenced by a piece in the piece table for thedocument. A block 44 shows the step for storing the data in the piecetable for each piece of inserted text. The following discussion explainshow this information thatis stored in the FCBs is referenced and used toidentify the type of paragraph delimiter used for the paragraph in whichis disposed any character of the document (native or imported) that isdisplayed on the display screen.

Determining Paragraph Delimiter Used Within a Piece of Text of aDocument

In a block 46, the word processing system determines the paragraphdelimiter that should be applied for a given character or piece of textinthe document by referring to the piece table. Based upon the filenumber found for the PCD that relates to the given piece of text, theword processing system determines the appropriate pointer to the FCB inwhich the paragraph delimiter that was used is indicated. Details of thestep implemented in block 46 are shown in FIG. 7.

First, in a block 100, the word processing system determines the piececontaining the given character to be displayed and the corresponding PCDin the array of data records. A block 102 provides for determining thefile number and range of file positions for each piece that is to bedisplayed and for determining the pointers to the FCB for the text thatisreferenced by the coordinates of the piece in the piece table.

For a given character position in the document, the word processingsystem searches the piece table for the document to locate the piecethat contains the character at the given character position. Using thePCD contained in the array of data records for that piece, the wordprocessingsystem determines the range of file positions containing allof the characters of the piece. In addition, the file position in thefile that corresponds to the character position is determined. Thischaracter position is represented by the variable cp. Similarly, cpPieceis a variable that represents the character position in the document forthe beginning of the piece in which cp is found. The value of cpPiece isdetermined by searching the piece table for the largest characterpositionthat is less than or equal to cp. The variable pcdPiece is thePCD entry inthe array of data records of the piece table thatcorresponds to cpPiece. The word processing system can then determinefc, the file coordinate of cp from the equation:

    fc=pcdPiece.fc+(cp-cpPiece)                                (1)

The file number of the piece that contains the character cp isrepresented by the variable pcdPiece.fn.

A block 103 in the flow chart indicates that the next step in the methodisto determine the beginning and limit character positions for theparagraph that contains the given text or character. In order to findthe beginning character position of a paragraph that contains thecharacter cp, the wordprocessing system first searches in the piecetable to find the character position of the beginning of the piece thatcontains the character, i.e., cpPiece, and then fetches thecorresponding PCD for that piece from the array of data records. Thecorresponding PCD is referred to as the pcdPiece. The word processingsystem determines the file coordinate fc forthe character usingEquation 1. With the file coordinate fc, the word processing system isable to use the pcd.fn to find a table of paragraph file coordinatesmaintained for each binary file. The word processing system can searchwithin this table to find the largest file coordinate that is less thanor equal to the fc of the character in the paragraph. Ifthe filecoordinate found is greater than pcdPiece.fc, the file coordinate forthe beginning of the paragraph is the file coordinate that wasfetchedfrom the table of paragraph file coordinates. Conversely, if thefile coordinate that was found is less than pcdPiece.fc, then thebeginning paragraph coordinate position is not within the current piece,but must reside in an earlier piece. In this case, it will be necessaryto search toward the beginning of the piece table until a filecoordinate range is found for a piece containing an fc recorded in theparagraph coordinate table of the document.

To find the limit position, cpLim, for the paragraph that contains thecharacter at coordinate cp, the word processing system again finds thecharacter position of the beginning of the piece containing thecoordinatecp in the piece table, i.e., cpPiece, and then fetches thecorresponding PCD from the piece table, pcdPiece. The word processingsystem again determines the file coordinate fc for the character usingEquation 1, and looks up the next cp entry in the piece table, settingcpLim to its value.The system determines the limit fc of the piececontaining the file coordinate for the character in the paragraph, whichis referred to by thevariable fcMac, using the following equation:

    fcMac=pcd.fc+(cpLim-cpPiece)                               (2)

The word processing system carries out a look up in the file coordinatetable referenced by pcd.fn in order to determine the largest fc that isless than or equal to the file coordinate of the character in theparagraph. The next fc in the file coordinate table, referred to asfcLim,is fetched. If fcLim is less than or equal to fcMac, the wordprocessing system has identified the file location of the end ofparagraph delimiter for the paragraph that contains the character inquestion. This file location is referred to as fcParaLim. The wordprocessing system then determines the character position coordinate forthe limit character position of the paragraph, cpLimPara, as follows:

    cpLimPara=cpPiece+(fcParaLim-pcd.fc)                       (3)

If fcLim is greater than fcMac, the piece does not contain an end ofparagraph delimiter. In that instance, the word processing systemsearchestoward the end of the piece table until an fc range is foundthat corresponds to a piece containing an fc recorded in the paragraphfile coordinate table of the file.

The fcMac calculated for the last PCD fetched, which corresponds to theendof paragraph delimiter for the paragraph containing the character,determines the type of paragraph delimiter in use. In order to reportthe size and type of paragraph delimiter, the word processing systemuses the pcd.fn from the last fetched PCD to access the FCB thatdescribes the filecontaining the paragraph mark so that it can determinethe values for the two paragraph delimiter bit fields f13Term and fCrLf.The values returned for these two bits from the pcd.fn are copiedrespectively to global flags, vf13Term and vfCrLf. After the paragraphbounds have been determined by the word processing system, if vfCrLf istrue, the word processing system knows that the paragraph whose boundshave been found ends with the paragraph delimiter two-byte sequence 1310. If the vf13Termis true on completion of the routine, the wordprocessing system knows thatthe paragraph ends with the paragraphdelimiter 13. Similarly, if neither of the global flags are true, theword processing system knows that the paragraph ends with the delimiter10.

A decision block 104 determines if the f13Term bit field in the FCB isequal to a binary 1 (true). If not, the word processing system knowsthat the paragraph delimiter for the piece in which the text is foundequals 10. Alternatively, if the result of the inquiry in decision block104 is positive, a decision block 110 checks to determine if the fCrLfflag has been set in the FCB. If so, as indicated in a block 112, theword processing system identifies the paragraph delimiter used as thesequence 10 13. Otherwise, the paragraph delimiter must be equal to thesingle character 13, as indicated in a block 114. Thereafter, the logicreturns to FIG. 3, as indicated by a block 108 in FIG. 7.

Displaying Text

The word processing system includes a routine for displaying text thathas been entered into a document. Under this routine, the wordprocessing system begins scanning the characters of the document at aparticular character position in the piece table, copying the charactersone at a time into a line description buffer. The line descriptionbuffer records the characters that are to be displayed on one line ofthe display screen.This scanning and copying routine is repeated untilthere is no further space available on the line to display anothercharacter, or until a character is encountered that terminates the line.In the preferred embodiment of the word processing system, there is alsoprovision for displaying a predetermined different character when aspecific character is encountered, by writing the different character tothe line descriptionbuffer instead of the specific character. Forexample, in WinWord 6, a special graphics symbol " " is optionallydisplayed to denote the end of aparagraph. When building the linedescription buffer a character at a time,the word processing systemdetermines the paragraph bounds for the character position at thebeginning of a line, initially checking the global terms vf13Term andvfcrLf, before beginning the layout of the rest of the line in thebuffer. If a 13 character is encountered and the globalflag vfCrLf isset to true, the word processing system knows that a character 10follows the 13 and that the two bytes together terminate the currentparagraph and the current line. Further, the word processing systemwrites a special byte code to the line description buffer that causesthe end of paragraph graphic symbol to be used (if that option iselected by the user), terminates the line being laid out, and setsvariables so that no character will be displayed to represent the 10used in the two-byte paragraph delimiter. If the word processing systemencounters a 13 paragraph delimiter and the lower case vf13Term flag isset, the word processing system knows that a single 13 paragraphdelimiterhas been encountered and that the special end of paragraphgraphic character should be substituted for this single delimiter.Finally, if a character 13 is encountered while the vf13Term flag isfalse, the word processing system knows that the character 13 is not anend of paragraph delimiter and should be displayed as a single characterwithin the line buffer. In an analogous manner, a character 10encountered while the vf13Term flag is set to false causes the wordprocessing system to recognize that the character 10 is an end ofparagraph delimiter, while ifthe flag is set to true, the character 10is retained and copied to the line layout buffer, so that it can bedisplayed. Using this technique, as indicated in a block 48, the wordprocessing system displays text built upin the line display buffer, byapplying the native paragraph delimiter to replace any non-nativeparagraph delimiter that is found and optionally using the special endof paragraph graphic symbol to indicate the end of aparagraph,regardless of the type of paragraph delimiter found.

Saving a Document

The method employed by the preferred embodiment of the word processingsystem requires that a particular paragraph delimiter format be useduniformly throughout a file. Thus, when a document that includes piecespasted from files using different paragraph delimiters is saved to afile,all of the text that is written to the file must use the nativeparagraph delimiter, which for WinWord 6 is the single character 13. Thetext of pieces that do not point at the file currently being saved arecopied to that file so that when the operation is complete, the PCDs ofaffected piece table entries are rewritten to point to the saved fileand the file position within the file where the text for the pieces isrecorded. Further, if a new file is created to store the contents of adocument, thetext of the pieces are written in character position orderinto the file sothat when the save is complete, the piece table for thenew file can be written to include only a single piece that describesall of the text in the new file.

To save a document that includes text pasted from one or more files,special processing must be done to ensure that paragraph delimiterscomprising the single 10 character or the 13 10 two-byte sequence arereplaced with a single 13 byte code. If the 13 10 sequence isencountered,only the first byte of the sequence needs to be written tothe file that isbeing saved, and the 10 portion of the two-byte sequencecan be deleted or dropped.

In the preferred embodiment, the word processing system saves a documentusing a routine called FetchCp that is passed a document number and aparticular character position within a file. The routine fetches textfromfiles into memory and returns a character pointer to one or morecharacter of text in the document. The beginning of the text pointed toby the pointer corresponds to the character position passed to theroutine. The FetchCp routine also reports the number of adjacentcharacters that were fetched from the document.

When a document is saved by the word processing system, the FetchCproutineis called repeatedly. The character position from which the textwill be fetched is incremented by the amount of text retrieved the lasttime that the routine was called. By thus incrementing the characterposition that is passed to the routine in this manner, all of the textin a document canbe fetched more efficiently. If a piece of textcontains only paragraphs that are represented by the single 13character, which is the native paragraph delimiter, the routine canbring as much of the text referenced by a piece as possible into memorywithout paying attention to paragraph bounds within the fetched text.However, if the text referenced by a piececontains the character 10 orthe two-byte sequence 13 10 used as a paragraph delimiter, the FetchCproutine reports the non-native paragraph delimiter to be at thebeginning of a buffer into which the text is loadedby the routine beforebeing written to the file. For example, if 15 bytes are retrieved from afile in which the 14th and 15th byte coordinates store a 13 10 sequenceas the paragraph delimiter, the FetchCp routine reports that only 13bytes were retrieved, thereby insuring that the next time the FetchCproutine is implemented, it will return the 13 10 sequenceat thebeginning of the buffer passed by the routine. It is also important thatthe FetchCp routine report the single character 10 paragraph delimiteror the two-byte sequence 13 10 paragraph delimiter as the onlycharacters returned by the routine if the character position passed intothe FetchCp routine is the beginning position of one of these paragraphdelimiters. This requirement ensures that, if the character fetched is asingle 10 character, the FetchCp routine will instead point at acharacter13, which is stored in a global variable, as a substitute forthe character10 that is actually fetched.

Details of the steps implemented in response to a decision block 50 inFIG.3, which determines if a document is being saved by the user, areshown in FIG. 8. Specifically, in a block 122, each character of thedocument is fetched from the file in which it is stored, into one ormore temporary buffers. As noted above, each foreign paragraph delimiterfetched by the FetchCp routine is placed at the beginning of a buffer. Adecision block 126 determines if any paragraph delimiter encounter isthe character 10 orthe two-byte sequence 10 13, and if so, a block 128provides for replacing the foreign paragraph delimiter with thecharacter 13 in the saved document file.

If the FetchCp routine reports that the two-byte sequence 13 10 has beenfetched and temporarily stored in a buffer (having length two), a flagis set that will be tested when the buffer is saved to file. The flagindicates that the buffer currently holds the paragraph delimitertwo-bytesequence 13 10. The save code transmits the first byte of thetwo-byte sequence to the file in which the document is being saved torepresent therequired paragraph mark, but blocks transmission of thecharacter 10 to thefile, as indicated in a block 128 in the flow chartof FIG. 8.

Anytime that the paragraph delimiter two-byte sequence 13 10 is thustransformed into the paragraph delimiter character 13 during the save ofthe document to a new file, the transformation invalidates the thencurrent piece table for the document and any other table of characterpositions (such as the table maintained for footnotes), which is kept bythe word processing system. Any entries in these table of characterpositions at coordinate positions greater than that of the current 13 10paragraph delimiter must be reduced by one, since the two-byte sequenceofthe paragraph delimiter has been replaced by a single character 13paragraph delimiter.

The updating of character position tables is performed after the lasttime that any of these tables is accessed during the save operation, butbeforethe tables are written to a file stored on hard drive 16. For allof the character position tables except the current piece table, theword processing system scans the document by repeatedly calling theFetchCp routine for each character within the document text stream,immediately before these tables are written. When the FetchCp routinereports that it has returned a pointer to a 13 10 paragraph delimiterthat was fetched from a file, the word processing system adjusts allcharacter position coordinates in the character position array of thetables that are greaterthan the current character position of theparagraph delimiter, by reducingthem by one position.

Producing a piece table to describe the location of the pieces within anewly saved file must be done with care, because the FetchCp routinethat reports the positions of each paragraph delimiter depends upon thePCD entries in the array of data records that point to the originalpieces of text and upon the character position coordinates recorded inthe original piece table for pieces that include any paragraph delimitertwo-byte sequences 13 10. Although it might be possible to create atransformed piece table in the memory allocation of the word processorand then replace the old piece table with the new during the saveprocedure for a document, this solution is not optimal and could fail attimes. For example, insufficient memory may be available in the personalcomputer system to hold a copy of even a small piece table. Frequently,when a saveoperation is executed, there is not even sufficient memoryavailable to create a very small data structure.

If the text of the document to be saved is being saved to an entirelynew file so that the text referenced by the pieces can be written to thefile in character position order, the original piece table can simply bediscarded and a new one built that covers the extent of all of thecharacters of the text. The save procedure can save the file coordinateswhere it began to write text, and the memory processing system will knowthe number of characters transmitted to the file. Accordingly, the piecetable can be created with an array of character positions containingonly two slots. The zero slot simply contains the character positionzero, and the first entry records the number of characters stored in thefile. Thus,the piece table holds a single PCD entry having a pcdfc thatrecords the file position only at the beginning of the text.

However, when the piece table must be maintained after the save, becausesome of the text is recorded in noncontiguous file coordinates, the saveprocess records a new version of the piece table on hard drive 16. Inthe new version of the piece table, character position coordinates arealteredto reflect changes to any translated two-byte sequence 13 10paragraph delimiters, and the pcd.fc values are changed to point to thelocations ofthe text referenced by the pieces in the newly saved file.Since the save procedure does not alter the original piece table, theFetchCp routine canbe called iteratively to check the text in theoriginal text file and report the character positions of any two-bytesequence 13 10 paragraph delimiters encountered. Then, as was donepreviously for other character position tables, the save proceduretransforms any character positions larger than the location of theparagraph delimiter by subtracting one from the coordinates for thosecharacter positions. It then writes the transformed entries to the harddrive for the new file. Once the save procedure is completed, the entireoriginal piece table for the document that was previously used isdiscarded, and the newly saved piece table is copied from hard drive 16into an allocated memory block. Thereafter, any calls to the wordprocessing system to fetch text will retrieve charactersfrom the newlysaved file rather than checking the original piece table forreferencesto the original files from which the pasted text was derived.

A block 132 in FIG. 8 provides for writing this new piece table to harddrive 16. Next, a decision block 134 determines if the save procedurehas been completed. If not, a block 136 provides for undoing the changesto the new piece table and for restoring the old paragraph delimiters tothe text. Thus, if a save process is terminated before complete, forexample, because there is insufficient space on the hard drive to save anew copy of the document, the word processing system will undo thechanges performed to any of the document character position tables. Inorder to properly fix these tables, the word processing system must knowhow many paragraph adjustments have been performed up to the point atwhich the save operation was interrupted. This information is maintainedby the wordprocessing system to cover such contingency. To recover froman interruptedsave operation, the word processing system executes aprocess that repeatedly calls the FetchCp routine, but in this case,adds one to each entry in the piece table having a character positionthat is larger than the file position of the paragraph delimiter foreach of the 13 10 sequences used for a paragraph delimiter in theoriginal text. This process is repeated until the same number ofcharacter position adjustments have been made, in which one is added toeach character position coordinate, as were done previously to adjustentries by subtracting one from each coordinate. When the process iscompleted, all of the original character positions in the piece tableare restored to their original values for all characters in thedocument. The logic then proceeds to a block 52 in which the flow chartends.

In the event that the document is not saved, the original piece table ismaintained, with references to each of the source files from which textusing foreign paragraph delimiters is stored. In this case, terminationofthe word processing system execution on computer system 10 results inthe logic proceeding to block 52.

Because text pasted into a document need not be scanned in its entiretyprior to display and editing of the text, the present method and wordprocessing system employing it are able to open a file so that text fromafile can be immediately displayed when that file is opened. It is onlywhenthe document in which the text is pasted is finally saved that thetranslation of the paragraph delimiters into the native paragraphdelimiter form is carried out in the file to which the document issaved. As a result, this word processing system and the method itemploys is veryefficient in handling imported text that uses foreignparagraph delimiters.

Although the present invention has been described in connection with itspreferred form of practicing the invention, those of ordinary skill intheart will understand that many modifications can be made theretowithin the scope of the claims that follow. Accordingly, it is notintended that the scope of the invention in any way be limited by theabove description, butthat the scope be determined entirely by referenceto the claims that follow.

The invention in which an exclusive right is claimed is defined by thefollowing:
 1. A method for properly displaying paragraphs of text thatuse a foreign paragraph delimiter, the foreign paragraph delimiter beingdifferent than a native paragraph delimiter of documents created on aword processing system, said method comprising the steps of:(a)producing a character position array in which each character of adocument that is open on the word processing system is assigned aposition, said character position array being divided into a pluralityof pieces, each piece comprising a string of characters that are storedadjacent to one another in a file and which have identical formatproperties; (b) producing an array of data records including entriesthat correspond to each piece of the character position array, eachentry including a file number and a file position within a file at whichthe string of characters comprising the piece are stored; (c) producinga file control block for each file storing text used in the documentwhen the file is initially opened by the word processing system; (d)inserting delimiter identification data in the file control block ofeach file, said delimiter identification data indicating a type ofparagraph delimiter used by the text stored in the file; (e) each timethat a character of the document is displayed, referring to thecharacter position array and to the array of data records to determine aspecific file in which the character is stored, the delimiteridentification data in the file control block for said specific fileindicating the type of paragraph delimiter that is used for a paragraphcontaining the character; and (f) if the paragraph containing thecharacter uses a foreign paragraph delimiter, translating the foreignparagraph delimiter to the native paragraph delimiter in a displaybuffer, so that the paragraph containing the character is properlydisplayed to the user.
 2. The method of claim 1, wherein all foreignparagraph delimiters used for text in the document are translated to thenative paragraph delimiters when the document is saved to a file.
 3. Themethod of claim 1, further comprising the step of checking for a headeror a trailer to the text in a file opened by the word processing system,said header or trailer at times indicating the type of paragraphdelimiter used by the text so that corresponding delimiteridentification data are provided in the file control block for saidfile.
 4. The method of claim 1, further comprising the steps of scanningat least a portion of the text in a text file opened by the wordprocessing system to identify a specific type of paragraph delimiterthat is used in said portion of the text, and specifying the delimiteridentification data corresponding to said specific type of paragraphdelimiter in the file control block for said text file.
 5. The method ofclaim 4, wherein occurrences of each of a plurality of different typesof paragraph delimiters are counted to identify which type of paragraphdelimiter occurs most often, the type of paragraph delimiter that occursmost often thus being determinative of the delimiter identification dataspecified for the file control block of said text file.
 6. The method ofclaim 1, further comprising the step of maintaining a table of limitfile positions within each file, said limit file position reporting aposition within the file of each paragraph delimiter used within thetext so that the paragraph delimiter used at that position can beidentified.
 7. The method of claim 1, further comprising the steps ofdetermining a beginning paragraph file position for a paragraph in whicha specific character of text is found; determining a limit characterposition of said paragraph; and reporting the size and type of theparagraph delimiter found at the end of said paragraph to determine thedelimiter identification data that is inserted into the file controlblock for the file.
 8. The method of claim 1, further comprising thesteps of using the delimiter identification data to identify anytwo-byte paragraph delimiter sequence that is used in the text; andprecluding an insertion point from being selected between the two-bytescomprising said two-byte paragraph delimiter sequence, during editing ofthe text.
 9. The method of claim 1, further comprising the steps ofdisplaying a special character that indicates an end of the paragraphfor any of the plurality of different types of paragraph delimiters usedfor the text being displayed; and not displaying foreign paragraphdelimiters.
 10. The method of claim 1, further comprising the stepsof:(a) translating any foreign paragraph delimiters to the nativeparagraph delimiter in the document when it is saved; (b) producing anew character position array that includes pieces without any foreignparagraph delimiters; and (c) producing a new array of data recordsincluding entries that correspond to each piece of the new characterposition array, each entry including a file number for the file in whichthe document is saved and a file position within said file.
 11. Themethod of claim 10, wherein after the document is saved, any calls bythe word processing system to retrieve text are directed to the file inwhich the document was saved.
 12. The method of claim 10, wherein if thestep of saving the document is interrupted before it completes, thecharacter position array and the array of data records originallyproduced are again referenced to ensure that all of the characterpositions in the document are restored to their original values,including any references to the foreign paragraph delimiters used fortext.
 13. A method for enabling a word processing system to properlyidentify and display paragraphs in a document that includes pasted text,said pasted text using a different type of paragraph delimiter than thatused by the word processing system, comprising the steps of:(a)assigning each character in the document a coordinate in a piece table,said piece table comprising a character position array and an array ofdata records, said character position array including a plurality ofpieces, each piece comprising at least one character, all characters ineach piece having common formatting properties and being stored in acontiguous string within a common file, said array of data recordsincluding a separate record corresponding to one of the pieces in thearray of character positions; (b) in each record of the array of datarecords, including a pointer to a file control block for the file inwhich all of the characters of the text in the piece are stored; (c)providing delimiter data bits in each of the file control blocks thatindicate the type of paragraph delimiter used for the text stored ineach file; (d) when a character of the document is selected by a userfor display, determining a specific file control block for the file inwhich the character is stored, based upon the position of the characterin the piece table; (e) identifying the paragraph delimiter that wasused in the text, as a function of the delimiter data bits in thespecific file control block determined in step (c); and (f) properlydisplaying the paragraph in which the character selected by the user iscontained by translating any paragraph delimiters in the text displayedto the type of paragraph delimiter used by the word processing system.14. The method of claim 13, wherein the delimiter data bits include abit indicating whether the paragraph delimiter includes a carriagereturn character and a bit indicating whether the paragraph delimiterincludes two characters instead of one character.
 15. The method ofclaim 13, further comprising the step of setting the delimiter data bitsin the file control block of an accessed file when said accessed file isopened to paste text in the accessed file into the document.
 16. Themethod of claim 15, wherein said accessed file that is opened is a wordprocessing file that includes data stored in it indicating the type ofparagraph delimiter used for the text in said word processing file. 17.The method of claim 15, wherein said accessed file is a text file,further comprising the step of checking each of the characters in atleast a portion of the text file to determine which type of paragraphdelimiter has been used within the text file.
 18. The method of claim17, wherein the step of determining the type of paragraph delimiter thatwas used includes the steps of separately counting each of the types ofparagraph delimiters found in the portion of the text file that waschecked, and identifying the type of paragraph delimiter that was usedin the text file as the type occurring most often in said portion. 19.The method of claim 13, further comprising the steps of determiningbounds of a paragraph containing a character to be displayed; and havingidentified an end of the paragraph, determining the number of charactersin the paragraph delimiter used for said paragraph.
 20. The method ofclaim 19, wherein the step of determining the bounds of the paragraphcomprise the step of referring to a paragraph file position table in thefile used to store the characters in one of the pieces, said paragraphfile position table reporting a limit file position for each paragraphdelimiter used in the text stored in said file.
 21. The method of claim13, further comprising steps of loading a display buffer with text to bedisplayed; and if said text uses a type of paragraph delimiter that isdifferent than the paragraph delimiter used by the word processingsystem, translating the type of paragraph delimiter used with said textinto the type of paragraph delimiter used by the word processing systemwithin the display buffer so that any paragraphs within said text aredisplayed as originally created.
 22. The method of claim 13, furthercomprising the steps of converting the different paragraph delimitersinto the type of paragraph delimiter used by the word processing system,at the time the document is saved to a file; and creating a new piecetable.
 23. The method of claim 22, wherein if an interruption occurswhile the document is being saved, the piece table in use before savingthe document was initiated is used to restore all characters in thedocument to their original pieces so that the paragraph delimiters usedfor each piece are again referenced by the file control blocks for thefiles in which the text of the pieces is stored.
 24. The method of claim13, further comprising the step of preventing insertion of text betweentwo characters comprising one of the types of paragraph delimiters inthe text pasted into the document.
 25. A word processing system in whichparagraphs of text that use a foreign paragraph delimiter are properlydisplayed, the foreign paragraph delimiter being different than a nativeparagraph delimiter of documents created on the word processing system,comprising:(a) a computer that includes a memory in which is stored aset of executable instructions, a non-volatile memory for storing datafiles and program files, a user interface for entering text andselecting control options, and a display for visually presenting textand control options to a user, said executable instructions causing thecomputer to operate as a word processor; (b) means for producing acharacter position array in which each character of a document that isopen on the word processing system is assigned a position, saidcharacter position array being divided into a plurality of pieces, eachpiece comprising a string of characters that are stored adjacent to oneanother in a file and which have identical format properties; (c)producing an array of data records including entries that correspond toeach piece of the character position array, each entry including a filenumber and a file position within a file at which the string ofcharacters comprising the piece are stored; (d) means for producing afile control block for each file that stores text used in the documentwhen the file is initially opened by the word processing system; (e)means for inserting delimiter identification data in the file controlblock of each file, said delimiter identification data indicating a typeof paragraph delimiter used by the text stored in the file; (f) meansfor determining a specific file in which a character of the documentthat is displayed is stored by referring to the character position arrayand to the array of data records, the delimiter identification data inthe file control block for said specific file indicating the type ofparagraph delimiter that is used for a paragraph containing thecharacter; and (g) means for translating any foreign paragraph delimiterto the native paragraph delimiter in a display buffer in the memory, sothat the paragraph containing the character is properly displayed to theuser on the display screen.
 26. The word processing system of claim 25,further comprising means for translating foreign paragraph delimitersused for text in the document to the native paragraph delimiters whenthe document is saved to a file.
 27. The word processing system of claim25, further comprising means for checking for a header or a trailer tothe text in a file opened by the word processing system, said header ortrailer at times indicating the type of paragraph delimiter used by thetext so that corresponding delimiter identification data are provided inthe file control block for said file.
 28. The word processing system ofclaim 25, further comprising means for scanning at least a portion ofthe text in a text file opened by the word processing system to identifya specific type of paragraph delimiter that is used in said portion ofthe text, and means for specifying the delimiter identification datacorresponding to said specific type of paragraph delimiter in the filecontrol block for said text file.
 29. The word processing system ofclaim 25, further comprising means for counting occurrences of each of aplurality of different types of paragraph delimiters to identify a typeof paragraph delimiter that occurs most often, the type of paragraphdelimiter that occurs most often thus being determinative of thedelimiter identification data specified for the file control block ofsaid text file.